package modele;

/**
 *
 * @author sio
 */
public class Med implements Comparable <Med>{
    private String nom;
    private String prenom;
    private String adresse;
    private String tel;
    private String spe;
    private String id;
    
    public Med(String nom, String prenom, String adresse, String tel, String spe, String id) {
        this.nom = nom;
        this.prenom = prenom;
        this.adresse = adresse;
        this.tel = tel;
        this.spe = spe;
        this.id = id;
    }
    
    public String getAdresse(){
        return adresse;
    }
    public String getNom(){
        return nom;
    }
    public String getPrenom(){
        return prenom;
    }
    public String getSpe(){
        return spe;
    }
    public String getTel(){
        return tel;
    }
    public int compareTo(Med m){
        if(nom.compareTo(m.nom) == 0){
            if(prenom.compareTo(m.prenom) == 0){
                return id.compareTo(m.id);
            }else{
                return prenom.compareTo(m.prenom);
            }
        }else{
            return nom.compareTo(m.nom);
        }
    }
}
